#!/bin/bash

work=/home/docker/firefox
rm -rf /home/docker/firefox
mkdir -p ${work}
cd ${work} || exit



yum remove docker docker-client docker-client-latest docker-common docker-latest  docker-latest-logrotate docker-logrotate docker-engine
yum install -y yum-utils git

git clone https://gitee.com/dx_wei/centos7-docker.git
cd ${work}/centos7-docker || exit

yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io

echo '{"registry-mirrors":["http://cr.laoyou.ip-ddns.com","http://docker.1panel.live","http://image.cloudlayer.icu","http://hub.fast360.xyz","http://docker-0.unsee.tech","http://docker.1panelproxy.com","http://docker.tbedu.top","http://dockerpull.cn","http://docker.m.daocloud.io","http://hub.rat.dev","http://docker.kejilion.pro","http://docker.hlmirror.com","http://docker.imgdb.de","http://docker.melikeme.cn","http://ccr.ccs.tencentyun.com","http://pull.loridocker.com"]}' > /etc/docker/daemon.json

systemctl start docker
systemctl enable docker

docker run -d hello-world


echo '==== install docker-compose ===='
cp ${work}/centos7-docker/docker-compose /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

sh ${work}/centos7-docker/firefox/run.sh

curl https://www.ip38.com | grep '</font><a href=//tool.ip38.com/ip/' |  grep -E '([0-9]{1,3}\.){3}[0-9]{1,3}'
